#include <iostream>
using namespace std;
int main()
{
	int cards[13] = {7, 5, 1, 2, 3, 6, 8, 11, 9, 12, 10, 4, 13};
	for (int i = 1; i < 13; i++) {
	    int target = cards[i], pos = 0;
	    while (target > cards[pos])
	        pos++;
	    for (int j = i; j > pos; j--)
	        cards[j] = cards[j - 1];
	    cards[pos] = target;
	}
	for(int i = 0; i < sizeof(cards)/sizeof(cards[0]); i++)
	{
		cout << cards[i] << " ";
	}
	return 0;
}

